Skip to content

[3주차] 이건희/[feat] 게시글 도메인 API 구현#115

Open
KunHeeLee7 wants to merge 9 commits intoLeets-Official:이건희/mainfrom
KunHeeLee7:이건희/3주차

Hidden character warning

The head ref may contain hidden characters: "\uc774\uac74\ud76c/3\uc8fc\ucc28"
Open

[3주차] 이건희/[feat] 게시글 도메인 API 구현#115
KunHeeLee7 wants to merge 9 commits intoLeets-Official:이건희/mainfrom
KunHeeLee7:이건희/3주차

Conversation

@KunHeeLee7
Copy link
Copy Markdown

@KunHeeLee7 KunHeeLee7 commented Apr 7, 2026

1. 과제 요구사항 중 구현한 내용

  • 게시글 생성, 목록 조회, 상세 조회, 수정, 삭제 API 구현
  • 명세서에 맞게 성공 응답 형식과 실패 응답 형식 구현
  • 소프트 딜리트 구현

2. 핵심 변경 사항

image
  • 프로젝트 구조 재설계 (계층 구조 -> 도메인 구조)
  • 게시글 생성 기능 구현
  • 게시글 상세 조회 기능 구현
  • 게시글 목록 조회 기능 구현
  • 게시글 수정 기능 구현
  • 소프트 딜리트 기능 구현
  • Global Exception handling 구현
  • 명세서에 맞게 성공 응답 형식과 예외처리 구현

3. 실행 및 검증 결과

  • 실행 결과:

  • [POST] 게시글 생성
    POST_api_posts

  • [GET] 게시글 목록 조회
    GET_api_posts

  • [GET] 특정 게시글 조회
    GET_api_posts_{post-id}

  • [PATCH] 게시글 수정
    PATCH_api_posts_{post-id}

  • [DELETE] 게시글 삭제
    DELETE_api_posts_{post-id}

  • [POST400_1] 제목이나 내용 미입력시 예외처리
    POST400_1

  • [POST400_2] 제목이 255자 초과시 예외처리
    POST400_2

  • [POST404_1] 잘못된 {post-id} 일 때 예외처리
    POST404_1

4. 완료 사항

  1. 게시글 CRUD
  2. 예외처리
  3. API 생성

5. 추가 사항

제출 체크리스트

  • PR 제목이 규칙에 맞다
  • base가 {이름}/main 브랜치다
  • compare가 {이름}/{숫자}주차 브랜치다
  • 프로젝트가 정상 실행된다
  • 본인을 Assignee로 지정했다
  • 파트 담당 Reviewer를 지정했다
  • 리뷰 피드백을 반영한 뒤 머지/PR close를 진행한다

Reviewer 참고

@KunHeeLee7 KunHeeLee7 requested a review from a team April 7, 2026 14:21
@KunHeeLee7 KunHeeLee7 self-assigned this Apr 7, 2026
Copy link
Copy Markdown

@kangyeson kangyeson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~!


public class PostForbiddenException extends RuntimeException {
public PostForbiddenException() {
super("수정 권한이 없습니다.");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에러마다 예외처리를 하기 보다, Post도메인의 공통 예외처리부분을 만들어두고 에러코드를 ENUM으로 관리하면 더 효율적이고 깔끔하게 관리할 수 있을 것 같습니다!

.result(null)
.build()
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GlobalExceptionHandler에는 모든 도메인에서 공통으로 사용하는 예외처리(인증실패, 서버에러)만을 담고, POST404_1과 같은 특정 도메인의 예외처리는 해당 도메인 Exception과 ErrorCode 아래에 만들어서 각 리소스의 역할을 명확히 구분해주신다면 좋을 것 같습니다!

Comment on lines +7 to +22
@Builder
public class ExceptionResponse {
private final boolean isSuccess;
private final String code;
private final String message;
private final Object result;

// 에러 발생 시 응답을 생성하는 정적 메서드
public static ExceptionResponse of(String code, String message) {
return ExceptionResponse.builder()
.isSuccess(false)
.code(code)
.message(message)
.result(null)
.build();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiResponse 와 exceptionResponse를 나누셨는데 공통응답포맷을 성공과 실패로 나누어야 할 필요가 있는지 나눈다면 어떤 이점이 있을지 알아보면 좋을 것 같습니다!

Copy link
Copy Markdown

@vyfhfhd vyfhfhd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석을 상세히 적어주셔서 전체적인 흐름을 이해하는 데 도움이 많이 되었습니다 감사합니다! 수고하셨어요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants